Repository navigation
fix(netssleay): bound RSA key generation sizes - #2171
Merged
Merged
Conversation
Reject RSA_generate_key sizes below the legacy 1024-bit floor and above 8192 bits before key generation. Retain 1024-bit generation for the bundled fast RSA round-trip test and existing OpenSSL-compatible callers, with a narrow CodeQL suppression documenting that exception. Generated with [Codex](https://openai.com/codex) Co-Authored-By: Codex <codex@openai.com>
Document that the bundled RSA round-trip test requests 1024 bits to keep the test fast, and distinguish that compatibility exception from new-key guidance. Generated with [Codex](https://openai.com/codex) Co-Authored-By: Codex <codex@openai.com>
fglock
added a commit
that referenced
this pull request
Nov 24, 2026
Restore the NetSSLeay source to the merged #2171 implementation after confirming the PR CodeQL alert remains present on the default branch. Issue: #2043 Generated with [Codex](https://openai.com/codex) Co-Authored-By: Codex <codex@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bound
Net::SSLeay::RSA_generate_keyto integer sizes from 1024 through 8192 bits. Invalid, weaker, and unbounded requests now returnundefbefore reaching the JCA provider.The 1024-bit floor is a deliberate legacy exception:
src/test/resources/unit/netssleay_phase5_6.trequests 1024 bits to keep its RSA round-trip test fast, and the OpenSSL-compatible API retains that caller-selected size. 1024-bit RSA is not suitable for new key material; the documentation recommends at least 2048 bits, and 3072 bits for 128-bit NIST strength. A narrow CodeQL suppression documents this compatibility case at the key-generation call.This addresses the existing master CodeQL alert #3, which currently makes PR #1938's CodeQL check fail.
Verification
nice -n 19 make— passed in 6m19 on the code and regression-test commit.perl src/test/resources/unit/netssleay_rsa_key_size_bounds.t— expected skip on system Perl because it tests the PerlOnJava adapter.timeout 120 ./jperl src/test/resources/unit/netssleay_rsa_key_size_bounds.t— 7/7 passed.timeout 120 ./jperl --interpreter src/test/resources/unit/netssleay_rsa_key_size_bounds.t— 7/7 passed.make check-links— passed.Checklist
makepasses on this branch.